# Makefile for building alvo package (C version)
# To use this file type "make -f unix.mk [entry-point]"
# or copy it to "Makefile" to avoid using the "-f unix.mk" option
# Entry Points:
# all           (Default) build alvo examples
# clean         Clean all object and executable files
# dos2unix      Fix source files that have any CR/LF -> LF

#CFLAGS for debugging  (gdb)
CFLAGS         = -g -I.
#CFLAGS for production
#CFLAGS          = -O

#CC sets the name of the compiler to use (cc, gcc, etc)
#You will have to change this to suit your system
#CC              := $(CC) -I.

CRFRAMES        = ../frames
#INCLUDE += ../cplus2

COCOR           = ../cocor -Z
DOS2UNIX        = ../dos2unix.sh

.DUMMY: x1 alvo

all: alvo
# 

alvo: x1 alvop.o alvo.o
	#

x1: alvo.frm alvo.atg
	CRFRAMES=$(CRFRAMES) $(COCOR) alvo.atg

alvo.o: alvo.cpp 
alvo.cpp: x1 
#alvo.frm

alvop.o alvo.o alvos.o: alvo.atg
	$(CC) $(CFLAGS) -c alvo.cpp alvop.cpp alvos.cpp

clean:
	set -i;
	-rm *.o alvo alvo?.cpp alvo?.hpp ?.cpp  ?.hpp *.lst

dos2unix:
	sh -c "$(DOS2UNIX) '*.cpp *.hpp Makefile *.frm *.atg'"
